#ifndef MotorJoystick_h
#define MotorJoystick_h

#include "Wire/Wire.h"
#include "arduinomega/WProgram.h"
#include <stdio.h>
#include "SoftwareSerial/SoftwareSerial.h"

#define MAXBAUDRATE 9600


#define rxPin 0
#define txPin 1

#define DC_MOTOR_LOW_POINT 300
#define DC_MOTOR_HIGH_POINT 600

// Hovercraft movement specifically DC motor movements
typedef enum {full_forward, full_reverse, turn_left, turn_right, brake} H_move;
typedef enum {r_forward, r_back, r_brake} R_status; // R for Reostat/Joystick

const int JMotorPin1 = 22; // enable pin
const int JMotorPin2 = 23;
const int JMotorPin3 = 24;
const int JMotorPin4 = 25;
const int JMotorPin5 = 26;

const int AnalogPin0 = 0;
const int AnalogPin1 = 1;

const byte addr = 0x09; // default address for BlinkM

class JoystickMotor
{
public:
	float AnalogVal1; // x
	float AnalogVal2; // y


	H_move H_movement; // howevercraft movement

	R_status X_status; // X Reostat status
	R_status Y_status; // Y Reostat status
	void setup();
	void loop();

	void BlinkM_begin(); // initialize blinkM device
	void ChangeBlinkMColor();
private:

	bool isJoystickMoved;
	float prevVal1; // previous x value
	float prevVal2; // previous y value


};

#endif
